<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增系统租户')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-tenant-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">租户中文名称：</label>
                <div class="col-sm-8">
                    <input name="tenantName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">租户英文简称：</label>
                <div class="col-sm-8">
                    <input name="tenantEnIntroduction" class="form-control" type="text" placeholder="作为租户管理员登录名，默认密码为admin123" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">租户地址：</label>
                <div class="col-sm-8">
                    <input name="tenantAddress" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">租户简介：</label>
                <div class="col-sm-8">
                    <input name="tenantIntroduction" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">租赁开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="tenantBeginTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">租赁结束时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="tenantEndTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">租户状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_tenant_status')}">
                        <input type="radio" th:id="${'tenantStatus_' + dict.dictCode}" name="tenantStatus" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
                        <label th:for="${'tenantStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/tenant"
        $("#form-tenant-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-tenant-add').serialize());
            }
        }

        $("input[name='tenantBeginTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='tenantEndTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>